﻿using System;

namespace System
{
    public static class ExceptionExtension
    {
        public static Exception GetOriginalException(this Exception ex)
        {
            while (ex.InnerException != null)
            {
                ex = ex.InnerException;
            }
            return ex;
        }
    }
}
